<?php
/**
 * | ---------------------------------------------------------------------------------------------------
 * | Author：johnxu <fsyzxz@163.com>.
 * | ---------------------------------------------------------------------------------------------------
 * | Home: https://www.johnxu.net.
 * | ---------------------------------------------------------------------------------------------------
 * | Data: 2018/12/31
 * | ---------------------------------------------------------------------------------------------------
 * | Desc: 异步写文件
 * | ---------------------------------------------------------------------------------------------------
 */

swoole_async_set( array(
    'log_level' => 5
) );

swoole_async_writefile( './2.txt', 'this content write by swoole.' . PHP_EOL, function ( $filename ) {
    var_dump( 'success . ' . $filename );
}, FILE_APPEND );

echo 'start write' . PHP_EOL;
